package com.weilele.leisure.time.ui.module.search


import android.os.Bundle
import com.weilele.base.library.BaseBindingFragment
import com.weilele.leisure.time.bean.VideoListBean
import com.weilele.leisure.time.databinding.FragmentVideoListBinding
import com.weilele.leisure.time.ui.holder.VideoItemHolder
import com.weilele.mvvm.adapter.refreshList

class VideoListFragment : BaseBindingFragment<FragmentVideoListBinding>() {
    private val adapter = VideoItemHolder.newInstance()
    override fun initUi(savedInstanceState: Bundle?) {
        super.initUi(savedInstanceState)
        mBinding.root.adapter = adapter
    }

    fun refresh(datas: MutableList<VideoListBean.RowsDTO>?) {
        adapter.refreshList(datas?.map { VideoItemHolder.Bean(it) }?.toMutableList())
    }
}